<%@ page language="java" import="java.util.*" pageEncoding="utf8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>数据库添加</title>

		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="this is my page">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<script type="text/javascript">
			function setStyle(x)
			{
				document.getElementById(x).select();
			}
		</script>
		<style>
#thisform {
	font-family: Georgia, serif;
	font-size: 12px;
	color: #999;
}

#thisform label {
	font-family: Verdana, sans-serif;
	font-weight: bold;
	color: #660000;
}

#thisform fieldset {
	border: 1px solid #cc;
	padding: 0 20px;
}

#thisform legend {
	font-family: arial, sans-serif;
	font-weight: bold;
	font-size: 90%;
	color: #666;
	background: #eee;
	border: 1px solid #ccc;
	border-bottom-color: #999;
	border-right-color: #999;
	padding: 4px 8px;
}
</style>
	</head>
  
  <body>
		<form action="adddberror.do" id="thisform" method="post">
			<fieldset>
				<legend>
					添加故障信息
				</legend>
				<p><h2>${msg}</h2></p>
				<p>
					<label for="ip">
						IP:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><input type="text" id="ip" name="ip" tabindex="2"></c:if>
					<c:if test="${map.mgrdberror!=null}"><input type="text" id="ip" name="ip" tabindex="2" value="<c:out value='${map.mgrdberror.ip}'/>"></c:if>
				</p>
				<c:if test="${'mysql'!=mapgroup.groupname}">
					<p>
					<label for="hostname">
						HostName:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><input type="text" id="hostname" name="hostname" tabindex="2"></c:if>
					<c:if test="${map.mgrdberror!=null}"><input type="text" id="hostname" name="hostname" tabindex="2" value="<c:out value='${map.mgrdberror.hostname}'/>"></c:if>
				</p>
				</c:if>
				<p>
					<label for="dbname">
						数据库:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><input type="text" id="dbname" name="dbname" tabindex="4"></c:if>
					<c:if test="${map.mgrdberror!=null}"><input type="text" id="dbname" name="dbname" tabindex="4" value="<c:out value='${map.mgrdberror.dbname}'/>"></c:if>
				</p>
				
				<p>
					<label for="faultdate">
						时间:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><input type="text" id="faultdate" name="faultdate" tabindex="4"></c:if>
					<c:if test="${map.mgrdberror!=null}"><input type="text" id="faultdate" name="faultdate" tabindex="4" value="<c:out value='${map.mgrdberror.faultdate}'/>"></c:if>
					(yyyy-MM-dd)
				</p>
				<p>
					<label for="applyperson">
						提交人:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><input type="text" id="applyperson" name="applyperson" tabindex="4"></c:if>
					<c:if test="${map.mgrdberror!=null}"><input type="text" id="applyperson" name="applyperson" tabindex="4" value="<c:out value='${map.mgrdberror.applyperson}'/>"></c:if>
				</p>
				<p>
					<label for="dbtype">
						用户组:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}">
					<select name="dbtype" tabindex="5" id="dbtype">
					<c:forEach var="group" items="${mapgroup.groupList}">
					  <option value="${group.id}" <c:if test="${group.mgrGroupName==mapgroup.groupname}">selected="selected"</c:if> >${group.mgrGroupName}</option>
				    </c:forEach>
				    </select>
					</c:if>
					<c:if test="${map.mgrdberror!=null}">
					<select name="dbtype" tabindex="5" id="dbtype">
						<c:forEach var="group" items="${map.groupList}">
					    <option value="${group.id}" <c:if test='${map.mgrdberror.dbtype==group.id }'>selected="selected"</c:if>>${group.mgrGroupName}</option>
				    </c:forEach>
				    </select>
					</c:if>
				</p>
				
				<p>
					<label for="phenomenon">
						现象:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><TEXTAREA cols="40" rows="2" name="phenomenon" id="phenomenon"></TEXTAREA></c:if>
					<c:if test="${map.mgrdberror!=null}"><TEXTAREA cols="40" rows="2" name="phenomenon" id="phenomenon"><c:out value='${map.mgrdberror.phenomenon}'/></TEXTAREA></c:if>
				</p>
				
				<p>
					<label for="analysis">
						分析说明:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><TEXTAREA cols="40" rows="" name="analysis" id="analysis"></TEXTAREA></c:if>
					<c:if test="${map.mgrdberror!=null}"><TEXTAREA cols="40" rows="" name="analysis" id="analysis"><c:out value='${map.mgrdberror.analysis}'/></TEXTAREA></c:if>
				</p>
				
				<p>
					<label for="disposalmethod">
						处理方法:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><TEXTAREA cols="40" rows="" name="disposalmethod" id="disposalmethod"></TEXTAREA></c:if>
					<c:if test="${map.mgrdberror!=null}"><TEXTAREA cols="40" rows="" name="disposalmethod" id="disposalmethod"><c:out value='${map.mgrdberror.disposalmethod}'/></TEXTAREA></c:if>
				</p>
				
				<p>
					<label for="emergencyplan">
						应急措施:
					</label>
					<br />
					<c:if test="${map.mgrdberror==null}"><TEXTAREA cols="40" rows="" name="emergencyplan" id="emergencyplan"></TEXTAREA></c:if>
					<c:if test="${map.mgrdberror!=null}"><TEXTAREA cols="40" rows="" name="emergencyplan" id="emergencyplan"><c:out value='${map.mgrdberror.emergencyplan}'/></TEXTAREA></c:if>
				</p>
				<p>
					<input type="hidden" value="<c:if test='${map.mgrdberror!=null}'><c:out value='${map.mgrdberror.id}'/></c:if>" name="id">
					<input type="hidden" value="<c:if test='${map.index!=null}'><c:out value='${map.index}'/></c:if>" name="index">
					<input type="submit" value="submit" tabindex="14" />
					<input type="button" value="cancel" tabindex="15" onclick="window.location.href='redirect.do?method=welcome'"/>
				</p>
			</fieldset>
		</form>
	</body>
</html>
